Skip to content

fix: enable custom model selection for Claude Code provider#1229

Open
pujan-modha wants to merge 2 commits intopingdotgg:mainfrom
pujan-modha:clean-fix
Open

fix: enable custom model selection for Claude Code provider#1229
pujan-modha wants to merge 2 commits intopingdotgg:mainfrom
pujan-modha:clean-fix

Conversation

@pujan-modha
Copy link

@pujan-modha pujan-modha commented Mar 20, 2026

What Changed

  • Allow threads to be created without a hardcoded model (model is now nullable)
  • Defer provider binding to first turn instead of thread creation, so users can switch to custom models (MiniMax, etc.) before sending their first message
  • Fix GUI app authentication by reading API credentials from ~/.claude/settings.json
  • Enable skills loading from settings.json via settingSources: ["user"]

Why

  • Threads were previously hardcoded to gpt-5-codex at creation, preventing users from selecting custom models like MiniMax, GLM, etc. Additionally, provider binding happened at thread creation which rejected any different model on the first turn.

  • This fix defers provider binding to the first turn, allowing users to explicitly select their desired model and provider before the session is bound. The fix also ensures GUI apps can authenticate properly and load skills from the user's settings.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Enable custom model selection for the Claude Code provider on first turn

  • Provider/model binding constraints in ProviderCommandReactor are now enforced only after a session exists; first turns can specify a provider or model that differs from the thread's configured model.
  • Adds isKnownModelSlug to model.ts to validate model slugs per provider; unknown slugs on first turn are not forwarded to the SDK.
  • Makes projection_threads.model nullable via a new DB migration (016) and updates related schemas in contracts and persistence layers.
  • Replaces process.env with environment variables sourced from ~/.claude/settings.json when invoking the Claude Agent SDK in ClaudeAdapter.ts.
  • Behavioral Change: auto-bootstrapped threads in wsServer.ts may now be created with model = null when no project default model exists.

Macroscope summarized 594b628.

- Allow threads to be created without a hardcoded model (model is now nullable)
- Defer provider binding to first turn instead of thread creation, so users can
  switch to custom models (MiniMax, etc.) before sending their first message
- Fix GUI app authentication by reading API credentials from ~/.claude/settings.json
- Enable skills loading from settings.json via settingSources: ["user"]

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ede2e732-811c-4e81-804a-d40578c98184

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can validate your CodeRabbit configuration file in your editor.

If your editor has YAML language server, you can enable auto-completion and validation by adding # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json at the top of your CodeRabbit configuration file.

@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 20, 2026
Replace raw JSON.parse with Effect.try and Schema.decodeUnknownSync
in getClaudeEnvFromSettings to align with Effect platform patterns
used elsewhere in the codebase (e.g., Identify.ts).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants